﻿using System;
using System.Collections.Generic;
using System.Web;
using System.ComponentModel;
using System.Runtime.Serialization;
/*[Table(Name = "dbo.ProjectCollections"), DataContract]*/
public class ProjectCollection : INotifyPropertyChanging, INotifyPropertyChanged
{
    // Fields
    private string _FeatureId;
    private int _Id;
    private string _LayoutId;
    private string _ProjectCollectionName;
    private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(string.Empty);

    // Events
    public event PropertyChangedEventHandler PropertyChanged;

    public event PropertyChangingEventHandler PropertyChanging;

    // Methods
    public ProjectCollection()
    {
        this.Initialize();
    }

    private void Initialize()
    {
    }

    [OnDeserializing, EditorBrowsable(EditorBrowsableState.Never)]
    public void OnDeserializing(StreamingContext context)
    {
        this.Initialize();
    }

    protected virtual void SendPropertyChanged(string propertyName)
    {
        if (this.PropertyChanged != null)
        {
            this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }
    }

    protected virtual void SendPropertyChanging()
    {
        if (this.PropertyChanging != null)
        {
            this.PropertyChanging(this, emptyChangingEventArgs);
        }
    }

    // Properties
    /*[Column(Storage = "_FeatureId", DbType = "NVarChar(255)"), DataMember(Order = 3)]*/
    public string FeatureId
    {
        get
        {
            return this._FeatureId;
        }
        set
        {
            if (this._FeatureId != value)
            {
                this.SendPropertyChanging();
                this._FeatureId = value;
                this.SendPropertyChanged("FeatureId");
            }
        }
    }

 /*   [DataMember(Order = 1), Column(Storage = "_Id", AutoSync = AutoSync.OnInsert, DbType = "Int NOT NULL IDENTITY", IsPrimaryKey = true, IsDbGenerated = true)]*/
    public int Id
    {
        get
        {
            return this._Id;
        }
        set
        {
            if (this._Id != value)
            {
                this.SendPropertyChanging();
                this._Id = value;
                this.SendPropertyChanged("Id");
            }
        }
    }

    /*[Column(Storage = "_LayoutId", DbType = "NVarChar(255)"), DataMember(Order = 2)]*/
    public string LayoutId
    {
        get
        {
            return this._LayoutId;
        }
        set
        {
            if (this._LayoutId != value)
            {
                this.SendPropertyChanging();
                this._LayoutId = value;
                this.SendPropertyChanged("LayoutId");
            }
        }
    }

    /*[DataMember(Order = 4), Column(Storage = "_ProjectCollectionName", DbType = "NVarChar(50)")]*/
    public string ProjectCollectionName
    {
        get
        {
            return this._ProjectCollectionName;
        }
        set
        {
            if (this._ProjectCollectionName != value)
            {
                this.SendPropertyChanging();
                this._ProjectCollectionName = value;
                this.SendPropertyChanged("ProjectCollectionName");
            }
        }
    }
}


